import { PageContainer } from '@ant-design/pro-layout';
import ProTable from '@ant-design/pro-table';

import React from 'react';
import type { ProColumns } from '@ant-design/pro-table';
import {WarehouseType} from '../../../model';
import {getSysLogList} from '../service';

export default () => {

  //表头信息以及表值设置
  const columns: ProColumns<WarehouseType>[] = [
    {
      title:'IP',
      hideInSearch:true,
      dataIndex: 'clientIp',
    },
    {
      title: '日期',
      dataIndex: 'data',
      hideInSearch:true,
    },
    {
      title: '用户',
      dataIndex: 'loginName',
      hideInSearch:true,
    },
    {
      title: '位置',
      dataIndex: 'method',
      hideInSearch:true,
      render:(_,record:any)=>record.module+'/'+record.method
    }
  ];

  return (
    <PageContainer>
    <ProTable
      headerTitle='日志列表'
      pagination={{
        pageSizeOptions:['20', '100', '500']
      }}
      request={(params,filter,sort)=>getSysLogList({...params})}
      columns={columns}
      rowKey="id"
      search={{
        labelWidth: 120,
      }}
      toolbar={{settings:[]}}
      />
  </PageContainer>
  );
};